package org.jiuling.tencentcloud.cos.config;

/**
 * 腾讯云对象存储配置
 * @author 紫灵
 * @date 2024年02月23日 11时20分55秒
 */
public class TencentCosConfig {

    /** COS的SecretId */
    private String secretId;
    /** COS的SecretKey */
    private String secretKey;
    /** 文件上传后访问路径的根路径，后面要最佳文件名字与类型 */
    private String urlPath;
    /** 上传的存储桶的地域 */
    private String bucketAddr;
    /** 存储桶的名字 */
    private String bucketName;

    public String getSecretId() {
        return secretId;
    }

    public void setSecretId(String secretId) {
        this.secretId = secretId;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getUrlPath() {
        return urlPath;
    }

    public void setUrlPath(String urlPath) {
        this.urlPath = urlPath;
    }

    public String getBucketAddr() {
        return bucketAddr;
    }

    public void setBucketAddr(String bucketAddr) {
        this.bucketAddr = bucketAddr;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    /**
     * 建造者
     * @return 建造者
     */
    public static Builder builder(){
        return new Builder();
    }

    /**
     * 建造者
     */
    public static class Builder{

        /** 腾讯云对象存储配置 */
        private final TencentCosConfig tencentCosConfig;

        public Builder() {
            this.tencentCosConfig = new TencentCosConfig();
        }

        public Builder addSecretId(String secretId) {
            tencentCosConfig.secretId = secretId;
            return this;
        }

        public Builder addSecretKey(String secretKey) {
            tencentCosConfig.secretKey = secretKey;
            return this;
        }

        public Builder addUrlPath(String urlPath) {
            tencentCosConfig.urlPath = urlPath;
            return this;
        }

        public Builder addBucketAddr(String bucketAddr) {
            tencentCosConfig.bucketAddr = bucketAddr;
            return this;
        }

        public Builder addBucketName(String bucketName) {
            tencentCosConfig.bucketName = bucketName;
            return this;
        }

        public TencentCosConfig build(){
            return tencentCosConfig;
        }


    }

}
